package com.ethink.gateway.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 业务配置
 *
 * @author yunduo
 */
@Data
@Component
@ConfigurationProperties(prefix = "ethink.gateway.common")
@RefreshScope
public class GateWayCommonProperties {

    /**
     * 响应对象打印的最大长度
     */
    private Integer responseLogMaxLength = 5000;

    /**
     * 不需要打印请求日志的路径
     */
    private List<String> requestLogExcludePaths;
    /**
     * 不需要响应请求日志的路径
     */
    private List<String> responseLogExcludePaths;

    /**
     * 防止恶意调用，对部分模拟请求进行拦截, 开启开关
     */
    private Boolean userAgentAllowEmpty = true;

    /**
     * 防止恶意调用，对部分模拟请求进行拦截, 请求header关键词
     */
    private List<String> userAgentBlackWords;

    /**
     * 不需要打印的header
     */
    private List<String> notLogHeaders;

}
